package com.xiaotu.service.master.impl;

import com.xiaotu.entity.master.Stu;
import com.xiaotu.mapper.mysql.StutMapper;
import com.xiaotu.service.master.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StuServiceImpl implements StuService {

    @Autowired
    private StutMapper stuDao;

    @Override
    public List<Stu> getAllStu() {

        System.out.println("StuServiceImpl");

        return stuDao.getAllStu();
    }

    @Override
    public void insert() {
        Stu stu = new Stu();
        stu.setName("王五");
        stuDao.insert(stu);
    }
}
